import { createApp } from "vue";

import App from "./App.vue";
import "tailwindcss/tailwind.css";
// import "virtual:windi.css";
import "vant/lib/index.css";
import ElementPlus from "element-plus";
import vant from "vant";
import "element-plus/dist/index.css";
import router from "@/router/index.ts";
import * as ElementPlusIconsVue from "@element-plus/icons-vue";
import zhCn from "element-plus/dist/locale/zh-cn.mjs";
import { ElMessage, ElLoading } from "element-plus";
import pinia from "@/store/pinia";
import piniaPersist from "pinia-plugin-persistedstate";
pinia.use(piniaPersist);
const app = createApp(App);
app.use(router);
app.use(vant);
app.provide("message", ElMessage);
app.provide("loading", ElLoading);

app.provide("global", {
  oss_url: "https://hfbqw.oss-cn-shanghai.aliyuncs.com/",
  accessKeyId: "LTAI5t9XhY21FrSHYm5XeYMN",
  accessKeySecret: "ENOdXFq7Gyrvgdcq6qDGCQT4VHbZtC",
  bucket: "hfbqw",
  region: "oss-cn-shanghai",
});
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component);
}
app.use(pinia);
app.use(ElementPlus, {
  locale: zhCn,
});
router.isReady().then(() => app.mount("#app"));
